package project.ui;

import java.util.Scanner;

import project.entity.Pet;
import project.entity.User;
import project.util.Seq;

public class Menu {
	private static Scanner sc = new Scanner(System.in);

	public static User loginMenu() {
		System.out.println("----------------");
		System.out.println("\t宠物信息管理系统");
		System.out.println("----------------");

		System.out.println("用户名：");
		String username = sc.nextLine();

		System.out.println("密码：");
		String password = sc.nextLine();

		return new User(username, password);
	}

	public static String mainMenu() {
		System.out.println("----------------");
		System.out.println("1.添加宠物信息");
		System.out.println("2.删除宠物信息");
		System.out.println("3.修改宠物价格");
		System.out.println("4.查询所有宠物");
		System.out.println("5.查询某个宠物");
		System.out.println("0.退出");
		System.out.println("----------------");
		System.out.println("请选择：");
		return sc.nextLine();
	}

	public static Pet addPetMenu() {
		System.out.print("请输入宠物类型:");
		String category = sc.nextLine();
		System.out.print("请输入宠物品种:");
		String kind = sc.nextLine();
		System.out.print("请输入宠物性别: ");
		String gender = sc.nextLine();
		System.out.print("请输入宠物年龄:");
		int age = Integer.parseInt(sc.nextLine());
		System.out.print("请输入宠物体重: ");
		double weight = Double.parseDouble(sc.nextLine());
		System.out.print("请输入宠物价格:");
		double price = Double.parseDouble(sc.nextLine());
		Pet pet = new Pet(category, kind, gender, age, weight, price);
		pet.setId(Seq.nextVal());
		return pet;
	}
	
	public static int delPetMenu() {
		System.out.println("请输入宠物编号：");
		return Integer.parseInt(sc.nextLine());
	}
	public static double updatePriceMenu() {
		System.out.println("请输入宠物价格：");
		return Double.parseDouble(sc.nextLine());
	}

}
